export default function(el, parent, style) {
  if(!parent)
    parent = 'body'

  el = document.createElement(el)
  if(style){
    if(typeof style === 'string')
      el.style = style
    else{
      el.setAttribute('style', '')
      for(let i in style)
        el.style[i] = style[i]
    }
  }
  parent = document.querySelector(parent)

  parent.appendChild(el)
  return el
}
